import { BasicColumn, FormSchema } from '/@/components/Table';
// import { rules } from '/@/utils/helper/validator';
import { useI18n } from '/@/hooks/web/useI18n';
const { t } = useI18n('system.position.fields');
const positionFields = {
  name: t('name'),
  postRank: t('postRank'),
};
export const columns: BasicColumn[] = [
  // {
  //   title: '职务编码',
  //   dataIndex: 'code',
  //   width: 200,
  //   align: 'left',
  // },
  {
    title: positionFields.name,
    dataIndex: 'name',
    align: 'left',
    // width: 200,
  },
  {
    title: positionFields.postRank,
    dataIndex: 'postRank_dictText',
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'name',
    label: positionFields.name,
    component: 'Input',
    colProps: { span: 8 },
  },
];

export const formSchema: FormSchema[] = [
  {
    label: '主键',
    field: 'id',
    component: 'Input',
    show: false,
  },
  {
    label: positionFields.postRank,
    field: 'postRank',
    component: 'JDictSelectTag',
    required: true,
    componentProps: {
      dictCode: 'position_rank',
      dropdownStyle: {
        maxHeight: '100vh',
      },
      getPopupContainer: () => document.body,
    },
  },
  {
    field: 'name',
    label: positionFields.name,
    component: 'Input',
    required: true,
  },
  // {
  //   field: 'code',
  //   label: '职务编码',
  //   component: 'Input',
  //   required: true,
  //   dynamicDisabled: ({ values }) => {
  //     return !!values.id;
  //   },
  //   dynamicRules: ({ model, schema }) => {
  //     return rules.duplicateCheckRule('sys_position', 'code', model, schema, true);
  //   },
  // },
];
